package com.wudd.entity.Do;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

@Component
public class CustomBeanPostProcessor implements BeanPostProcessor {
	@Override
	public Object postProcessBeforeInitialization(Object bean, String beanName)
			throws BeansException {
		if (bean.getClass() == User.class) {
			System.out.println("调用postProcessBeforeInitialization...");
		}
		return bean;
	}

	@Override
	public Object postProcessAfterInitialization(Object bean, String beanName)
			throws BeansException {
		if (bean.getClass() == User.class) {
			System.out.println("调用postProcessAfterInitialization...");
		}
		return bean;
	}
}
